/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package crm.salesOrderProcessing.entity;

import crm.clientManagement.entity.CompanyEntity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author frankxgz
 */
@Entity
public class SalesInquiryEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    @Temporal(value = TemporalType.DATE)
    private Date raiseDate;
    
    @ManyToOne(targetEntity=CompanyEntity.class,cascade={CascadeType.PERSIST})
    private CompanyEntity company;
    
    @OneToMany(targetEntity = LineItemEntity.class, cascade={CascadeType.PERSIST})
    private List<LineItemEntity> InquiryLineItems = new ArrayList<LineItemEntity>();
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

 
    public CompanyEntity getCompany() {
        return company;
    }

    public void setCompany(CompanyEntity company) {
        this.company = company;
    }

    public List<LineItemEntity> getInquiryLineItems() {
        return InquiryLineItems;
    }

 
    public void setInquiryLineItems(List<LineItemEntity> inquiryLineItems) {
        this.InquiryLineItems=inquiryLineItems;
    }
    
      @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SalesInquiryEntity)) {
            return false;
        }
        SalesInquiryEntity other = (SalesInquiryEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sales.entity.salesInquiry[ id=" + id + " ]";
    }

    /**
     * @return the raiseDate
     */
    public Date getRaiseDate() {
        return raiseDate;
    }

    /**
     * @param raiseDate the raiseDate to set
     */
    public void setRaiseDate(Date raiseDate) {
        this.raiseDate = raiseDate;
    }
 
}
